package com.ra.exception;

import com.ra.enums.StatusCodeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Author : 今晚几点睡_Ada
 * Date: 2023/3/10
 * Time: 14:04
 * 注:
 */
@Getter
@AllArgsConstructor
public class BizException extends Exception{

    private Integer code = StatusCodeEnum.ERROR.getCode();

    private final String message;

    public BizException(String message) {
        this.message = message;
    }

    public BizException(StatusCodeEnum statusCodeEnum) {
        this.code = statusCodeEnum.getCode();
        this.message = statusCodeEnum.getDesc();
    }
}
